var id = null;
function getQueryVariable(variable)
{
    var query = window.location.search.substring(1);
    var vars = query.split("&");
    for (var i=0;i<vars.length;i++) {
        var pair = vars[i].split("=");
        if(pair[0] == variable){return pair[1];}
    }
    return null;
}
function dealUpdate(url,successFun) {
    id = getQueryVariable("id");
    console.log(id);
    if(id == null) {
        console.log("新增");
        return;
    }
    $.ajax({
        type : "GET",
        url : url,
        data : {
            "id": id,
        },
        success : function(result) {
            if(result.code==1) {
               successFun(result);
            } else {
                $.toaster({ priority : "danger", title : "通知", message : "请求话术失败" })
            }
            console.log(result);
        },
        error : function(e){
            $.toaster({ priority : "danger", title : "通知", message : "请求话术失败" })
        }
    });
}
